package com.anbang.app.ui.frame.study.recycleView.adapter

import android.graphics.Color
import android.view.View
import android.widget.TextView
import com.ab.filemanager.base.adapter.BaseViewHolder
import com.anbang.app.R

/**
 * 瀑布流Item
 */
class StaggeredItemViewHolder(itemView: View) : BaseViewHolder(itemView) {

    private val contentTv: TextView = findView(R.id.contentTv)

    init {

    }

    override fun bindViewHolder(any: Any) {
        var str = any as String

        contentTv.text = str

        rootView.layoutParams = rootView.layoutParams.apply {
            height = Math.max(200, Math.random().times(550).toInt())
            rootView.setBackgroundColor(Color.rgb(100, (Math.random().times(255)).toInt(), Math.random().times(255).toInt()))
        }
    }

}